Optimal. Leaf size=193 \[ \frac {a^3 b^3 \tanh ^{-1}\left (\frac {b \cos (x)-a \sin (x)}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{7/2}}-\frac {a^3 b^2 \cos (x)}{\left (a^2+b^2\right )^3}+\frac {a b^2 \cos ^3(x)}{3 \left (a^2+b^2\right )^2}-\frac {a \cos ^3(x)}{3 \left (a^2+b^2\right )}+\frac {a \cos ^5(x)}{5 \left (a^2+b^2\right )}+\frac {a^2 b^3 \sin (x)}{\left (a^2+b^2\right )^3}-\frac {a^2 b \sin ^3(x)}{3 \left (a^2+b^2\right )^2}+\frac {b \sin ^3(x)}{3 \left (a^2+b^2\right )}-\frac {b \sin ^5(x)}{5 \left (a^2+b^2\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.25, antiderivative size = 193, normalized size of antiderivative = 1.00, number of steps
used = 17, number of rules used = 9, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.450, Rules used = {3188, 2644,
14, 2645, 30, 2717, 2718, 3153, 212} \begin {gather*} -\frac {b \sin ^5(x)}{5 \left (a^2+b^2\right )}+\frac {b \sin ^3(x)}{3 \left (a^2+b^2\right )}-\frac {a^2 b \sin ^3(x)}{3 \left (a^2+b^2\right )^2}+\frac {a \cos ^5(x)}{5 \left (a^2+b^2\right )}-\frac {a \cos ^3(x)}{3 \left (a^2+b^2\right )}+\frac {a b^2 \cos ^3(x)}{3 \left (a^2+b^2\right )^2}+\frac {a^2 b^3 \sin (x)}{\left (a^2+b^2\right )^3}-\frac {a^3 b^2 \cos (x)}{\left (a^2+b^2\right )^3}+\frac {a^3 b^3 \tanh ^{-1}\left (\frac {b \cos (x)-a \sin (x)}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{7/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 30
Rule 212
Rule 2644
Rule 2645
Rule 2717
Rule 2718
Rule 3153
Rule 3188
Rubi steps
\begin {align*} \int \frac {\cos ^3(x) \sin ^3(x)}{a \cos (x)+b \sin (x)} \, dx &=\frac {a \int \cos ^2(x) \sin ^3(x) \, dx}{a^2+b^2}+\frac {b \int \cos ^3(x) \sin ^2(x) \, dx}{a^2+b^2}-\frac {(a b) \int \frac {\cos ^2(x) \sin ^2(x)}{a \cos (x)+b \sin (x)} \, dx}{a^2+b^2}\\ &=-\frac {\left (a^2 b\right ) \int \cos (x) \sin ^2(x) \, dx}{\left (a^2+b^2\right )^2}-\frac {\left (a b^2\right ) \int \cos ^2(x) \sin (x) \, dx}{\left (a^2+b^2\right )^2}+\frac {\left (a^2 b^2\right ) \int \frac {\cos (x) \sin (x)}{a \cos (x)+b \sin (x)} \, dx}{\left (a^2+b^2\right )^2}-\frac {a \text {Subst}\left (\int x^2 \left (1-x^2\right ) \, dx,x,\cos (x)\right )}{a^2+b^2}+\frac {b \text {Subst}\left (\int x^2 \left (1-x^2\right ) \, dx,x,\sin (x)\right )}{a^2+b^2}\\ &=\frac {\left (a^3 b^2\right ) \int \sin (x) \, dx}{\left (a^2+b^2\right )^3}+\frac {\left (a^2 b^3\right ) \int \cos (x) \, dx}{\left (a^2+b^2\right )^3}-\frac {\left (a^3 b^3\right ) \int \frac {1}{a \cos (x)+b \sin (x)} \, dx}{\left (a^2+b^2\right )^3}-\frac {\left (a^2 b\right ) \text {Subst}\left (\int x^2 \, dx,x,\sin (x)\right )}{\left (a^2+b^2\right )^2}+\frac {\left (a b^2\right ) \text {Subst}\left (\int x^2 \, dx,x,\cos (x)\right )}{\left (a^2+b^2\right )^2}-\frac {a \text {Subst}\left (\int \left (x^2-x^4\right ) \, dx,x,\cos (x)\right )}{a^2+b^2}+\frac {b \text {Subst}\left (\int \left (x^2-x^4\right ) \, dx,x,\sin (x)\right )}{a^2+b^2}\\ &=-\frac {a^3 b^2 \cos (x)}{\left (a^2+b^2\right )^3}+\frac {a b^2 \cos ^3(x)}{3 \left (a^2+b^2\right )^2}-\frac {a \cos ^3(x)}{3 \left (a^2+b^2\right )}+\frac {a \cos ^5(x)}{5 \left (a^2+b^2\right )}+\frac {a^2 b^3 \sin (x)}{\left (a^2+b^2\right )^3}-\frac {a^2 b \sin ^3(x)}{3 \left (a^2+b^2\right )^2}+\frac {b \sin ^3(x)}{3 \left (a^2+b^2\right )}-\frac {b \sin ^5(x)}{5 \left (a^2+b^2\right )}+\frac {\left (a^3 b^3\right ) \text {Subst}\left (\int \frac {1}{a^2+b^2-x^2} \, dx,x,b \cos (x)-a \sin (x)\right )}{\left (a^2+b^2\right )^3}\\ &=\frac {a^3 b^3 \tanh ^{-1}\left (\frac {b \cos (x)-a \sin (x)}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{7/2}}-\frac {a^3 b^2 \cos (x)}{\left (a^2+b^2\right )^3}+\frac {a b^2 \cos ^3(x)}{3 \left (a^2+b^2\right )^2}-\frac {a \cos ^3(x)}{3 \left (a^2+b^2\right )}+\frac {a \cos ^5(x)}{5 \left (a^2+b^2\right )}+\frac {a^2 b^3 \sin (x)}{\left (a^2+b^2\right )^3}-\frac {a^2 b \sin ^3(x)}{3 \left (a^2+b^2\right )^2}+\frac {b \sin ^3(x)}{3 \left (a^2+b^2\right )}-\frac {b \sin ^5(x)}{5 \left (a^2+b^2\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.63, size = 223, normalized size = 1.16 \begin {gather*} -\frac {2 a^3 b^3 \tanh ^{-1}\left (\frac {-b+a \tan \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{7/2}}+\frac {-30 a \left (a^4+8 a^2 b^2-b^4\right ) \cos (x)-5 a \left (a^4-2 a^2 b^2-3 b^4\right ) \cos (3 x)+3 a^5 \cos (5 x)+6 a^3 b^2 \cos (5 x)+3 a b^4 \cos (5 x)-30 a^4 b \sin (x)+240 a^2 b^3 \sin (x)+30 b^5 \sin (x)+15 a^4 b \sin (3 x)+10 a^2 b^3 \sin (3 x)-5 b^5 \sin (3 x)-3 a^4 b \sin (5 x)-6 a^2 b^3 \sin (5 x)-3 b^5 \sin (5 x)}{240 \left (a^2+b^2\right )^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.41, size = 302, normalized size = 1.56
method | result | size |
default | \(-\frac {16 a^{3} b^{3} \arctanh \left (\frac {2 a \tan \left (\frac {x}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\left (8 a^{6}+24 a^{4} b^{2}+24 a^{2} b^{4}+8 b^{6}\right ) \sqrt {a^{2}+b^{2}}}+\frac {2 b^{3} a^{2} \left (\tan ^{9}\left (\frac {x}{2}\right )\right )+2 a \,b^{4} \left (\tan ^{8}\left (\frac {x}{2}\right )\right )+2 \left (\frac {16}{3} b^{3} a^{2}+\frac {4}{3} b^{5}\right ) \left (\tan ^{7}\left (\frac {x}{2}\right )\right )+2 \left (-2 a^{5}-6 a^{3} b^{2}\right ) \left (\tan ^{6}\left (\frac {x}{2}\right )\right )+2 \left (-\frac {16}{5} b \,a^{4}+\frac {34}{15} b^{3} a^{2}-\frac {8}{15} b^{5}\right ) \left (\tan ^{5}\left (\frac {x}{2}\right )\right )+2 \left (\frac {2}{3} a^{5}-\frac {10}{3} a^{3} b^{2}+2 a \,b^{4}\right ) \left (\tan ^{4}\left (\frac {x}{2}\right )\right )+2 \left (\frac {16}{3} b^{3} a^{2}+\frac {4}{3} b^{5}\right ) \left (\tan ^{3}\left (\frac {x}{2}\right )\right )+2 \left (-\frac {2}{3} a^{5}-\frac {14}{3} a^{3} b^{2}\right ) \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+2 b^{3} a^{2} \tan \left (\frac {x}{2}\right )-\frac {4 a^{5}}{15}-\frac {28 a^{3} b^{2}}{15}+\frac {2 a \,b^{4}}{5}}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) \left (a^{2}+b^{2}\right ) \left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )^{5}}\) | \(302\) |
risch | \(-\frac {i {\mathrm e}^{3 i x} b}{96 \left (-2 i a b +a^{2}-b^{2}\right )}-\frac {{\mathrm e}^{3 i x} a}{96 \left (-2 i a b +a^{2}-b^{2}\right )}+\frac {i {\mathrm e}^{i x} a b}{-12 i a^{2} b +4 i b^{3}+4 a^{3}-12 a \,b^{2}}-\frac {{\mathrm e}^{i x} a^{2}}{16 \left (-3 i a^{2} b +i b^{3}+a^{3}-3 a \,b^{2}\right )}+\frac {{\mathrm e}^{i x} b^{2}}{-48 i a^{2} b +16 i b^{3}+16 a^{3}-48 a \,b^{2}}-\frac {i {\mathrm e}^{-i x} a b}{4 \left (i b +a \right )^{3}}-\frac {{\mathrm e}^{-i x} a^{2}}{16 \left (i b +a \right )^{3}}+\frac {{\mathrm e}^{-i x} b^{2}}{16 \left (i b +a \right )^{3}}+\frac {i {\mathrm e}^{-3 i x} b}{96 \left (i b +a \right )^{2}}-\frac {{\mathrm e}^{-3 i x} a}{96 \left (i b +a \right )^{2}}-\frac {i b^{3} a^{3} \ln \left ({\mathrm e}^{i x}-\frac {i b +a}{\sqrt {-a^{2}-b^{2}}}\right )}{\sqrt {-a^{2}-b^{2}}\, \left (a^{2}+b^{2}\right )^{3}}+\frac {i b^{3} a^{3} \ln \left ({\mathrm e}^{i x}+\frac {i b +a}{\sqrt {-a^{2}-b^{2}}}\right )}{\sqrt {-a^{2}-b^{2}}\, \left (a^{2}+b^{2}\right )^{3}}-\frac {a \cos \left (5 x \right )}{80 \left (-a^{2}-b^{2}\right )}+\frac {b \sin \left (5 x \right )}{-80 a^{2}-80 b^{2}}\) | \(400\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 521 vs.
\(2 (177) = 354\).
time = 0.49, size = 521, normalized size = 2.70 \begin {gather*} \frac {a^{3} b^{3} \log \left (\frac {b - \frac {a \sin \left (x\right )}{\cos \left (x\right ) + 1} + \sqrt {a^{2} + b^{2}}}{b - \frac {a \sin \left (x\right )}{\cos \left (x\right ) + 1} - \sqrt {a^{2} + b^{2}}}\right )}{{\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \sqrt {a^{2} + b^{2}}} - \frac {2 \, {\left (2 \, a^{5} + 14 \, a^{3} b^{2} - 3 \, a b^{4} - \frac {15 \, a^{2} b^{3} \sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac {15 \, a b^{4} \sin \left (x\right )^{8}}{{\left (\cos \left (x\right ) + 1\right )}^{8}} - \frac {15 \, a^{2} b^{3} \sin \left (x\right )^{9}}{{\left (\cos \left (x\right ) + 1\right )}^{9}} + \frac {10 \, {\left (a^{5} + 7 \, a^{3} b^{2}\right )} \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - \frac {20 \, {\left (4 \, a^{2} b^{3} + b^{5}\right )} \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} - \frac {10 \, {\left (a^{5} - 5 \, a^{3} b^{2} + 3 \, a b^{4}\right )} \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}} + \frac {2 \, {\left (24 \, a^{4} b - 17 \, a^{2} b^{3} + 4 \, b^{5}\right )} \sin \left (x\right )^{5}}{{\left (\cos \left (x\right ) + 1\right )}^{5}} + \frac {30 \, {\left (a^{5} + 3 \, a^{3} b^{2}\right )} \sin \left (x\right )^{6}}{{\left (\cos \left (x\right ) + 1\right )}^{6}} - \frac {20 \, {\left (4 \, a^{2} b^{3} + b^{5}\right )} \sin \left (x\right )^{7}}{{\left (\cos \left (x\right ) + 1\right )}^{7}}\right )}}{15 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6} + \frac {5 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + \frac {10 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}} + \frac {10 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \sin \left (x\right )^{6}}{{\left (\cos \left (x\right ) + 1\right )}^{6}} + \frac {5 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \sin \left (x\right )^{8}}{{\left (\cos \left (x\right ) + 1\right )}^{8}} + \frac {{\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \sin \left (x\right )^{10}}{{\left (\cos \left (x\right ) + 1\right )}^{10}}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.21, size = 307, normalized size = 1.59 \begin {gather*} \frac {15 \, \sqrt {a^{2} + b^{2}} a^{3} b^{3} \log \left (\frac {2 \, a b \cos \left (x\right ) \sin \left (x\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} - 2 \, a^{2} - b^{2} - 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cos \left (x\right ) - a \sin \left (x\right )\right )}}{2 \, a b \cos \left (x\right ) \sin \left (x\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + b^{2}}\right ) + 6 \, {\left (a^{7} + 3 \, a^{5} b^{2} + 3 \, a^{3} b^{4} + a b^{6}\right )} \cos \left (x\right )^{5} - 10 \, {\left (a^{7} + 2 \, a^{5} b^{2} + a^{3} b^{4}\right )} \cos \left (x\right )^{3} - 30 \, {\left (a^{5} b^{2} + a^{3} b^{4}\right )} \cos \left (x\right ) - 2 \, {\left (3 \, a^{6} b - 11 \, a^{4} b^{3} - 16 \, a^{2} b^{5} - 2 \, b^{7} + 3 \, {\left (a^{6} b + 3 \, a^{4} b^{3} + 3 \, a^{2} b^{5} + b^{7}\right )} \cos \left (x\right )^{4} - {\left (6 \, a^{6} b + 13 \, a^{4} b^{3} + 8 \, a^{2} b^{5} + b^{7}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}{30 \, {\left (a^{8} + 4 \, a^{6} b^{2} + 6 \, a^{4} b^{4} + 4 \, a^{2} b^{6} + b^{8}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 361 vs.
\(2 (177) = 354\).
time = 0.48, size = 361, normalized size = 1.87 \begin {gather*} \frac {a^{3} b^{3} \log \left (\frac {{\left | 2 \, a \tan \left (\frac {1}{2} \, x\right ) - 2 \, b - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, a \tan \left (\frac {1}{2} \, x\right ) - 2 \, b + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{{\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \sqrt {a^{2} + b^{2}}} + \frac {2 \, {\left (15 \, a^{2} b^{3} \tan \left (\frac {1}{2} \, x\right )^{9} + 15 \, a b^{4} \tan \left (\frac {1}{2} \, x\right )^{8} + 80 \, a^{2} b^{3} \tan \left (\frac {1}{2} \, x\right )^{7} + 20 \, b^{5} \tan \left (\frac {1}{2} \, x\right )^{7} - 30 \, a^{5} \tan \left (\frac {1}{2} \, x\right )^{6} - 90 \, a^{3} b^{2} \tan \left (\frac {1}{2} \, x\right )^{6} - 48 \, a^{4} b \tan \left (\frac {1}{2} \, x\right )^{5} + 34 \, a^{2} b^{3} \tan \left (\frac {1}{2} \, x\right )^{5} - 8 \, b^{5} \tan \left (\frac {1}{2} \, x\right )^{5} + 10 \, a^{5} \tan \left (\frac {1}{2} \, x\right )^{4} - 50 \, a^{3} b^{2} \tan \left (\frac {1}{2} \, x\right )^{4} + 30 \, a b^{4} \tan \left (\frac {1}{2} \, x\right )^{4} + 80 \, a^{2} b^{3} \tan \left (\frac {1}{2} \, x\right )^{3} + 20 \, b^{5} \tan \left (\frac {1}{2} \, x\right )^{3} - 10 \, a^{5} \tan \left (\frac {1}{2} \, x\right )^{2} - 70 \, a^{3} b^{2} \tan \left (\frac {1}{2} \, x\right )^{2} + 15 \, a^{2} b^{3} \tan \left (\frac {1}{2} \, x\right ) - 2 \, a^{5} - 14 \, a^{3} b^{2} + 3 \, a b^{4}\right )}}{15 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} {\left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right )}^{5}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.64, size = 600, normalized size = 3.11 \begin {gather*} \frac {\frac {8\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3\,\left (4\,a^2\,b^3+b^5\right )}{3\,\left (a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6\right )}-\frac {4\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2\,\left (a^5+7\,a^3\,b^2\right )}{3\,\left (a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6\right )}-\frac {4\,{\mathrm {tan}\left (\frac {x}{2}\right )}^6\,\left (a^5+3\,a^3\,b^2\right )}{a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6}-\frac {2\,\left (2\,a^5+14\,a^3\,b^2-3\,a\,b^4\right )}{15\,\left (a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6\right )}+\frac {4\,{\mathrm {tan}\left (\frac {x}{2}\right )}^4\,\left (a^5-5\,a^3\,b^2+3\,a\,b^4\right )}{3\,\left (a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6\right )}+\frac {8\,b^3\,{\mathrm {tan}\left (\frac {x}{2}\right )}^7\,\left (4\,a^2+b^2\right )}{3\,\left (a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6\right )}+\frac {2\,a^2\,b^3\,\mathrm {tan}\left (\frac {x}{2}\right )}{a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6}+\frac {2\,a\,b^4\,{\mathrm {tan}\left (\frac {x}{2}\right )}^8}{a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6}+\frac {2\,a^2\,b^3\,{\mathrm {tan}\left (\frac {x}{2}\right )}^9}{a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6}-\frac {4\,b\,{\mathrm {tan}\left (\frac {x}{2}\right )}^5\,\left (24\,a^4-17\,a^2\,b^2+4\,b^4\right )}{15\,\left (a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6\right )}}{{\mathrm {tan}\left (\frac {x}{2}\right )}^{10}+5\,{\mathrm {tan}\left (\frac {x}{2}\right )}^8+10\,{\mathrm {tan}\left (\frac {x}{2}\right )}^6+10\,{\mathrm {tan}\left (\frac {x}{2}\right )}^4+5\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+1}+\frac {2\,a^3\,b^3\,\mathrm {atanh}\left (\frac {2\,a^6\,b+2\,b^7+6\,a^2\,b^5+6\,a^4\,b^3-2\,a\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6\right )}{2\,{\left (a^2+b^2\right )}^{7/2}}\right )}{{\left (a^2+b^2\right )}^{7/2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________